package com.liduanwei.update.util

import java.io.IOException

class OSUtil {
    companion object {
        fun getOSName(): String {
            return System.getProperty("os.name")
        }


        fun isLinux(): Boolean {
            return !getOSName().toLowerCase().contains("windows")
        }

        fun exec(cmds: Array<String>) {
            try {
                Runtime.getRuntime().exec(cmds)
            } catch (e: IOException) {
                //e.printStackTrace()
            }
        }

        fun exec(cmd: String) {
            try {
                Runtime.getRuntime().exec(cmd)
            } catch (e: IOException) {
                //e.printStackTrace()
            }
        }
    }
}